<route lang="json5" type="page">
  {
    layout: 'default',
    style: {
      navigationBarTitleText: '班级',
    },
    anonymous: false
  }
</route>

<script lang="ts" setup>
import ClassListTab from './components/ClassListTab.vue'
import { loginRoute } from '@/interceptors/route'
import { useUserStore } from '@/stores'

const userStore = useUserStore()

onShow(() => {
  if (!userStore.isLogin()) {
    uni.navigateTo({ url: loginRoute })
  }
})

const tabs = ref([
  { name: '上课中', status: 1 },
  { name: '未开课', status: 0 },
  { name: '已结课', status: 2 },
])

const tab = ref(0)
</script>

<template>
  <wd-tabs v-model="tab" inactive-color="#86909C" :sticky="true" :line-width="24" :line-height="4">
    <block v-for="(item, index) in tabs" :key="index">
      <wd-tab :title="`${item.name}`">
        <ClassListTab :status="item.status" />
      </wd-tab>
    </block>
  </wd-tabs>
</template>

<style lang="scss" scoped>

</style>
